package com.geek.javase.ch18.videodemo.reflect.methods;

/*
 *@Date 2025/11/5
 *@Author wangpeng
 *@Description TODO
 */
public class User {
    private String name;

    public User() {
    }

    public User(String name) {
        this.name = name;
    }
    public void eat(){
        System.out.println(name+"在吃饭");
    }
    //这里指定了sleep（）是私有的
    private String sleep(){
        System.out.println("在睡觉");
        return name;
    }

    public static void play(int a ){
        System.out.println("在打游戏"+a);
    }

    /**
     * 获取
     * @return name
     */
    public String getName() {
        return name;
    }

    /**
     * 设置
     * @param name
     */
    public void setName(String name) {
        this.name = name;
    }

    public String toString() {
        return "User{name = " + name + "}";
    }
}
